package com.shutong.edu.invoke.retry.common;

import com.shutong.edu.invoke.retry.model.RetryInfo;

/**
 *
 * @ClassName: RetryCheck.java
 * @author: Naughty Guo
 * @date: Jun 2, 2016
 */
public class RetryCheck {

    /**
     * check whether retry again.
     *
     * @param retryInfo
     * @return boolean
     * @author Naughty Guo Jun 2, 2016
     */
    public static boolean doRetry(RetryInfo retryInfo) {
        if (retryInfo.getExecutedTimes() < retryInfo.getTimes()) {
            retryInfo.incrementExecutedTimes();
            return true;
        }
        return false;
    }
}
